package genericity.boundary;

import genericity.GTest;

public class Test {
	
	
	//查找一个泛型数组中大于某个特定元素的个数
	public static <T extends Comparable<T>> int countGreaterThan(T[] anArray, T elem) {
	    int count = 0;
	    for (T e : anArray)
	        if (e.compareTo(elem) > 0)
	            ++count;
	    return count;
	}
	
	public static void testBoundary(){
		System.out.println("边界符：使用<T extends Comparable<T>>方式告诉编译器，泛型需要实现Comparable接口");
		System.out.println(GTest.SPLIT);
	}
	
	
	
	
	
	
}
